#include <stdio.h>
#include <iostream>
#include <unistd.h>
#include <sys/msg.h>
#include <sys/ipc.h>
#include <sys/types.h>

using namespace std;

typedef struct msgbu{
    long type;
    char masg[1024];
}msgbu;

int main()
{
    int qid = msgget(0x55555555, IPC_CREAT | 0664);
    if(qid < 0){
        perror("msgget");
        return -1;
    }
    msgbu b;
    msgrcv(qid, &b, sizeof(b.masg), 7, 0);
    cout<<b.masg;
    return 0;
}
